<template>
	<view :style="themeColor">
		<view class="page">
			<view class="flex benben-position-layout flex flex-wrap align-center packageRecord_flex_0"
				:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
				<view class='flex flex-wrap align-center justify-between flex-sub packageRecord_fd0_0'>
					<view class='flex flex-wrap align-center packageRecord_fd0_0_c0' @tap="handleJumpDiy"
						data-type="back" data-url="1">
						<text class='fu-iconfont2  packageRecord_fd0_0_c0_c0'>&#xe794;</text>
					</view>
					<text class='packageRecord_fd0_0_c1'>我的套餐</text>
					<view class='flex flex-wrap align-center packageRecord_fd0_0_c0'>
					</view>
				</view>

			</view>
			<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
			<!---flex布局flex布局开始-->
			<view class="flex benben-flex-layout flex-wrap align-center">
				<view>
					<benben-flex-tabs class-name='packageRecord_benbenTabsfd1_0' v-model="tabs" ref="benben_tabsfd1_0"
						select-mark="benben_tabsfd1_0" key="benben_tabsfd1_0" :open-title-type='false'
						:open-sticky='true' :top='88' :is-show-content='true' :scrollspy='false'
						:tabs-info.sync="tabsInfofd1_0" @change="getSwiutchFunc()">

						<scroll-view @scroll="tabsInfofd1_0.scrollX = $event.detail.scrollLeft" id="benben_tabsfd1_0"
							class="benben-tabs" style="width:750rpx" :scroll-x="true"
							:scroll-left.sync="tabsInfofd1_0.moveX" scroll-with-animation="all .3s ease">
							<view class="benben-tabs-content" id="benben_tabsfd1_0-content">
								<view id="benben_tabsfd1_0-title"
									class="benben-tabs-title flex flex align-center justify-around">
									<view
										:class="{ 'checkTitlefd1_0': tabs == '1', 'flex flex-wrap align-center': true }"
										@tap="tabs = '1'" :id="`benben_tabsfd1_0-title-item-${'1'}`">

										<text>可用套餐</text>

									</view>
									<view
										:class="{ 'checkTitlefd1_0': tabs == '2', 'flex flex-wrap align-center': true }"
										@tap="tabs = '2'" :id="`benben_tabsfd1_0-title-item-${'2'}`">

										<text>失效套餐</text>

									</view>
									<view
										:class="{ 'checkTitlefd1_0': tabs == '3', 'flex flex-wrap align-center': true }"
										@tap="tabs = '3'" :id="`benben_tabsfd1_0-title-item-${'3'}`">

										<text>套餐记录</text>

									</view>
								</view>
								<view :style="{ left: tabsInfofd1_0.lineleft, maxWidth: tabsInfofd1_0.lineWidth ,}"
									id="benben_tabsfd1_0-line"
									class="benben-tabs-line flex benben-flex-tabs-line packageRecord_linefd1_0"></view>
							</view>
						</scroll-view>

					</benben-flex-tabs>
					<view>
						<view
							class="benben_tabsfd1_0-body-item flex flex-direction flex-wrap align-stretch packageRecord_bodyfd1_0_c3"
							v-if=" tabs == '1' " :id="`benben_tabsfd1_0-body-item-${'1'}`">
							<template v-for='(item,key0) in cardList'>
								<view class='flex flex-wrap align-center packageRecord_bodyItemfd1_0_c3_c0' :key='key0'>
									<image class='packageRecord_bodyItemfd1_0_c3_c0_c0' mode="aspectFill"
										:src='item.picture'></image>
									<view
										class='flex flex-direction flex-wrap align-stretch flex-sub packageRecord_bodyItemfd1_0_c3_c0_c1'>
										<text
											class='flex-sub packageRecord_bodyItemfd1_0_c3_c0_c1_c0'>{{item.service_meal_name}}</text>
										<view
											class='flex flex-wrap align-center packageRecord_bodyItemfd1_0_c3_c0_c1_c1'>
											<text class='packageRecord_bodyItemfd1_0_c3_c0_c1_c1_c0'>￥</text>
											<text class=' packageRecord_bodyItemfd1_0_c3_c0_c1_c1_c1'>
												<text
													class=' packageRecord_price1_bodyItemfd1_0_c3_c0_c1_c1_c1'>{{ item.money | frontPrice }}</text>
												<text
													class=' packageRecord_price2_bodyItemfd1_0_c3_c0_c1_c1_c1'>{{ item.money | laterPrice }}</text>
											</text>
										</view>
										<view class='flex flex-wrap align-center self-center'>
											<view class='flex flex-direction flex-wrap align-stretch flex-sub'>
												<view
													class='flex flex-wrap align-center packageRecord_bodyItemfd1_0_c3_c0_c1_c1'>
													<text
														class='packageRecord_bodyItemfd1_0_c3_c0_c1_c2_c0_c0_c0'>剩余次数：</text>
													<text
														class='packageRecord_bodyItemfd1_0_c3_c0_c1_c2_c0_c0_c1'>{{item.re_num}}</text>
													<text
														class='packageRecord_bodyItemfd1_0_c3_c0_c1_c2_c0_c0_c1'>次</text>
												</view>
												<view class='flex flex-wrap align-center'>
													<text
														class='packageRecord_bodyItemfd1_0_c3_c0_c1_c2_c0_c0_c0'>套餐有效期：</text>
													<text
														class='packageRecord_bodyItemfd1_0_c3_c0_c1_c2_c0_c0_c0'>{{item.effective_day}}</text>
													<text
														class='packageRecord_bodyItemfd1_0_c3_c0_c1_c2_c0_c0_c0'>天</text>
												</view>
											</view>
											<button class='self-end packageRecord_bodyItemfd1_0_c3_c0_c1_c2_c1'
												@tap.stop="handleJumpDiy" data-type="navigateTo"
												:data-url="`/pages/index/placeOrder/placeOrder?id=${item.serviceproject_id}&card_id=${item.aid}&cardType=1`">立即预约</button>
										</view>
									</view>
								</view>
							</template>
							<fu-empty :pagingListLoadedAll="pagingListLoadedAll"
								:pagingListNoListData="pagingListNoListData" :listDataLength="listDataLength"
								:isLoadInit="isLoadInit"></fu-empty>
						</view>
						<view
							class="benben_tabsfd1_0-body-item flex flex-direction flex-wrap align-stretch packageRecord_bodyfd1_0_c3"
							v-if=" tabs == '2' " :id="`benben_tabsfd1_0-body-item-${'2'}`">
							<template v-for='(item,key0) in cardList'>
								<view class='flex flex-wrap align-center packageRecord_bodyItemfd1_0_c3_c0' :key='key0'>
									<image class='packageRecord_bodyItemfd1_0_c3_c0_c0' mode="aspectFill"
										:src='item.picture'></image>
									<view
										class='flex flex-direction flex-wrap align-stretch flex-sub packageRecord_bodyItemfd1_0_c3_c0_c1'>
										<text
											class='flex-sub packageRecord_bodyItemfd1_0_c3_c0_c1_c0'>{{item.service_meal_name}}</text>
										<view
											class='flex flex-wrap align-center packageRecord_bodyItemfd1_0_c3_c0_c1_c1'>
											<text class='packageRecord_bodyItemfd1_0_c3_c0_c1_c1_c0'>￥</text>
											<text class=' packageRecord_bodyItemfd1_0_c3_c0_c1_c1_c1'>
												<text
													class=' packageRecord_price1_bodyItemfd1_0_c3_c0_c1_c1_c1'>{{ item.money | frontPrice }}</text>
												<text
													class=' packageRecord_price2_bodyItemfd1_0_c3_c0_c1_c1_c1'>{{ item.money | laterPrice }}</text>
											</text>
										</view>
										<view class='flex flex-wrap align-center self-center'>
											<view class='flex flex-direction flex-wrap align-stretch flex-sub'>
												<view
													class='flex flex-wrap align-center packageRecord_bodyItemfd1_0_c3_c0_c1_c1'>
													<text
														class='packageRecord_bodyItemfd1_0_c3_c0_c1_c2_c0_c0_c0'>剩余次数：</text>
													<text
														class='packageRecord_bodyItemfd1_0_c3_c0_c1_c2_c0_c0_c1'>{{item.re_num}}</text>
													<text
														class='packageRecord_bodyItemfd1_0_c3_c0_c1_c2_c0_c0_c1'>次</text>
												</view>
												<view class='flex flex-wrap align-center'>
													<text
														class='packageRecord_bodyItemfd1_0_c3_c0_c1_c2_c0_c0_c0'>套餐有效期：</text>
													<text
														class='packageRecord_bodyItemfd1_0_c3_c0_c1_c2_c0_c0_c0'>{{item.effective_day}}</text>
													<text
														class='packageRecord_bodyItemfd1_0_c3_c0_c1_c2_c0_c0_c0'>天</text>
												</view>
											</view>
											<button class='self-end packageRecord_bodyItemfd1_0_c4_c0_c1_c2_c1'
												v-if=" item.card_status=='2'">已失效</button>
										</view>
									</view>
								</view>
							</template>
							<fu-empty :pagingListLoadedAll="pagingListLoadedAll"
								:pagingListNoListData="pagingListNoListData" :listDataLength="listDataLength"
								:isLoadInit="isLoadInit"></fu-empty>
						</view>
						<view
							class="benben_tabsfd1_0-body-item flex flex-direction flex-wrap align-stretch packageRecord_bodyfd1_0_c3"
							v-if=" tabs == '3' " :id="`benben_tabsfd1_0-body-item-${'3'}`">
							<template v-for='(item,key0) in recordList'>
								<view class='flex flex-wrap align-center packageRecord_bodyItemfd1_0_c3_c0' :key='key0'>
									<image class='packageRecord_bodyItemfd1_0_c3_c0_c0' mode="aspectFill"
										:src='item.picture'></image>
									<view
										class='flex flex-direction flex-wrap align-stretch flex-sub packageRecord_bodyItemfd1_0_c5_c0_c1'>
										<text
											class='flex-sub packageRecord_bodyItemfd1_0_c5_c0_c1_c0'>{{item.card_name}}</text>
										<view
											class='flex flex-wrap align-center packageRecord_bodyItemfd1_0_c5_c0_c1_c1'>
											<text class='packageRecord_bodyItemfd1_0_c3_c0_c1_c2_c0_c0_c0'>使用时间：</text>
											<text
												class='packageRecord_bodyItemfd1_0_c3_c0_c1_c2_c0_c0_c0'>{{item.create_time}}</text>
										</view>
									</view>
								</view>
							</template>
							<fu-empty :pagingListLoadedAll="pagingListLoadedAll"
								:pagingListNoListData="pagingListNoListData" :listDataLength="listDataLength"
								:isLoadInit="isLoadInit"></fu-empty>
						</view>
					</view>
				</view>
			</view>

			<!---flex布局flex布局结束-->


		</view>
	</view>
</template>
<script>
	import pagingList from '@/common/mixin/paging_list.js';
	import {
		validate
	} from '@/common/utils/validate.js'

	export default {
		components: {},
		mixins: [pagingList],

		data() {
			return {
				"tabsInfofd1_0": {
					lineleft: '',
					lineWidth: '',
					moveX: 0,
					scrollX: 0,
					PageScrollX: 0
				},
				"minixPagingListsApi": "",
				"pageingListApiMethod": "",
				"allowOnloadGetList": false,
				"cardList": [],
				"tabs": "1",
				"recordList": []
			};
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},

		},
		watch: {},
		onLoad(options) {
			this.getSwiutchFunc()
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {

		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {
			this.getSwiutchFunc()
		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			//切换是次卡还是记录
			getSwiutchFunc() {
				if (this.tabs < '3') {
					this.minixPagingListsApi = global.apiUrls.post6537654e85245;
					this.pageingListApiMethod = 'get';
					this.allowOnloadGetList = false;
					this.pagingListPostDataContent = {
						card_status: this.tabs
					}
					this.listData = [];
					this.cardList = this.listData;
					this.pagingListToggle();

				} else if (this.tabs == '3') {
					this.minixPagingListsApi = global.apiUrls.post6537871117482;
					this.pageingListApiMethod = 'get';
					this.allowOnloadGetList = false;
					this.pagingListPostDataContent = {}
					this.listData = [];
					this.recordList = this.listData;
					this.pagingListToggle();

				}
			},
			pagingListPostData() {
				return this.pagingListPostDataContent
			}
		}
	};
</script>
<style lang="scss" scoped>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: rgba(248, 248, 248, 1);
		background-size: 100% auto;
	}

	.packageRecord_flex_0 {
		background: #fff;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.packageRecord_fd0_0_c1 {
		font-size: 36rpx;
		font-weight: 500;
		color: #333;
	}

	.packageRecord_fd0_0_c0_c0 {
		font-size: 32rpx;
		color: #333;
	}

	.packageRecord_fd0_0_c0 {
		width: 120rpx;
		height: 88rpx;
	}

	.packageRecord_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
		height: 88rpx;
	}

	.packageRecord_bodyItemfd1_0_c5_c0_c1_c1 {
		margin: 8rpx 0rpx 0rpx 0rpx;
	}

	.packageRecord_bodyItemfd1_0_c5_c0_c1_c0 {
		color: #333333;
		font-size: 32rpx;
		font-weight: 700;
		line-height: 45rpx;
		-webkit-line-clamp: 1;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		margin: 0rpx 0rpx 0rpx 0rpx;
	}

	.packageRecord_bodyItemfd1_0_c5_c0_c1 {
		margin: 0rpx 0rpx 0rpx 24rpx;
		height: 180rpx;
	}

	.packageRecord_bodyItemfd1_0_c4_c0_c1_c2_c1 {
		background: rgba(246, 246, 246, 1);
		border-radius: 33rpx 33rpx 33rpx 33rpx;
		width: 120rpx;
		line-height: 60rpx;
		font-size: 24rpx;
		color: rgba(51, 51, 51, 1);
	}

	.packageRecord_bodyItemfd1_0_c3_c0_c1_c2_c1 {
		background: var(--benbenbgColor2);
		border-radius: 33rpx 33rpx 33rpx 33rpx;
		width: 140rpx;
		line-height: 60rpx;
		font-size: 24rpx;
		color: #fff;
	}

	.packageRecord_bodyItemfd1_0_c3_c0_c1_c2_c0_c0_c1 {
		font-size: 24rpx;
		font-weight: 400;
		color: rgba(153, 153, 153, 1);
		line-height: 33rpx;
	}

	.packageRecord_bodyItemfd1_0_c3_c0_c1_c2_c0_c0_c0 {
		font-size: 24rpx;
		font-weight: 400;
		color: #999999;
		line-height: 33rpx;
	}

	.packageRecord_price2_bodyItemfd1_0_c3_c0_c1_c1_c1 {
		font-size: 28rpx;
	}

	.packageRecord_price1_bodyItemfd1_0_c3_c0_c1_c1_c1 {
		font-size: 32rpx;
	}

	.packageRecord_bodyItemfd1_0_c3_c0_c1_c1_c1 {
		color: #ff5536;
		font-weight: 600;
	}

	.packageRecord_bodyItemfd1_0_c3_c0_c1_c1_c0 {
		font-size: 24rpx;
		font-weight: 400;
		color: rgba(255, 85, 54, 1);
		line-height: 33rpx;
	}

	.packageRecord_bodyItemfd1_0_c3_c0_c1_c1 {
		margin: 0rpx 0rpx 8rpx 0rpx;
	}

	.packageRecord_bodyItemfd1_0_c3_c0_c1_c0 {
		color: #333333;
		font-size: 32rpx;
		font-weight: 700;
		line-height: 45rpx;
		-webkit-line-clamp: 1;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		margin: 0rpx 0rpx 8rpx 0rpx;
	}

	.packageRecord_bodyItemfd1_0_c3_c0_c1 {
		margin: 0rpx 0rpx 0rpx 24rpx;
	}

	.packageRecord_bodyItemfd1_0_c3_c0_c0 {
		width: 180rpx;
		height: 180rpx;
		border-radius: 15rpx 15rpx 15rpx 15rpx;
	}

	.packageRecord_bodyItemfd1_0_c3_c0 {
		background: rgba(255, 255, 255, 1);
		background-size: 100% auto;
		border-radius: 16rpx;
		padding: 24rpx 24rpx 24rpx 24rpx;
		margin: 0rpx 0rpx 20rpx 0rpx;
	}

	.packageRecord_bodyfd1_0_c3 {
		padding: 20rpx 24rpx 0rpx 24rpx;
	}

	.packageRecord_linefd1_0 {
		background: var(--benbenbgColor2);
		width: 50rpx;
		height: 8rpx;
		top: 80rpx;
		background-size: 100% auto !important;
		border-radius: 16rpx;
	}

	.checkTitlefd1_0 {
		font-weight: 700 !important;
		font-size: 28rpx !important;
		color: #E31D1A !important;
		background-color: rgba(255, 255, 255, 1) !important;
	}

	::v-deep .packageRecord_benbenTabsfd1_0 {
		background: #fff;
		width: 750rpx;
		height: 90rpx;
		white-space: nowrap;
		text-align: center;
	}
</style>